#include<bits/stdc++.h>
using namespace std;
/*struct node{
    int x[15];
};*/
int n,m;
/*int cnt;
int ans[15][15];*/
int g[2][20000005];
const int N=998244353;
/*void dfs(node x,int len)
{
    if(len==m)
    {
        for(int i=1;i<=n;i++)
        {
            if(x.x[i]!=i)
            {
                return;
            }
        }
        cnt++;
        return;
    }
    for(int i=1;i<=n;i++)
    {
        dfs(x,len+1);
        swap(x.x[i],x.x[i+1]);
    }
}*/
signed main()
{
    freopen("drama.in","r",stdin);
    freopen("drama.out","w",stdout);
    /*node csh;
    for(int i=1;i<=10;i++)
    {
        csh.x[i]=i;
    }
    for(int nt=1;nt<=10;nt++)
    {
        for(int mt=0;mt<=8;mt++)
        {
            n=nt;
            m=mt;
            cnt=0;
            dfs(csh,0);
            ans[nt][mt]=cnt;
            cout<<cnt<<" ";
        }
        cout<<endl;
    }
    cout<<endl;
    for(int i=1;i<=10;i++)
    {
        for(int j=0;j<=8;j++)
        {
            cout<<ans[i][j]-ans[i-1][j]<<" ";
        }
        cout<<endl;
    }*/
    cin>>n>>m;
    g[0][0]=1;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        int flag=i%2;
        for(int j=0;j<=m;j++)
        {
            if(j==0)
            {
                g[flag][j]=0;
                continue;
            }
            g[flag][j]=g[1-flag][j-1]+1LL*i*g[flag][j-1]%N;
            g[flag][j]%=N;
            //cout<<g[flag][j]<<" ";
        }
        //cout<<endl;
        ans+=g[flag][m];
        ans%=N;
    }
    cout<<ans;
    return 0;
}
